import request from '../util/request'

const baseUrl = process.env.NODE_ENV === 'production' ? '' : '/vehicleMap'
const baseUrlPark = process.env.NODE_ENV === 'production' ? '' : '/pc2200'
// pc2200.pacargle.com

  export function  searchState1Api(mac,roleCode){
      return request({
        url: mac.substring(0,3) == '555' ? baseUrlPark+ '/mp/allStatusByroleCode' : baseUrlPark+ '/mp/allStatusByroleCode',
        method:"get",
        params:{
          mac:mac,
          roleCode:roleCode
        }
      })

  }


  export function  loadMacApi(params){
    return request({
      url:baseUrl+"/lclock/lockVo2",
      method:"get",
      params:params
    })
  }


  export function  chargeCalcApi(mac,roleCode){
    return request({
      url: mac.substring(0,3) == '555' ? baseUrlPark+ '/mp/chargeCalcByroleCode' : baseUrlPark+ '/mp/chargeCalcByroleCode',
      method:"get",
      params:{
        mac:mac,
        roleCode:roleCode
      }
    })

}

export function  chargeStatusApi(mac,roleCode){
  return request({
    url: mac.substring(0,3) == '555' ? baseUrlPark+ '/mp/chargeStatusByroleCode' : baseUrlPark+ '/mp/chargeStatusByroleCode',
    method:"get",
    params:{
      mac:mac,
      roleCode:roleCode
    }
  })

}
  
export function  getPicApi(mac,roleCode){
  return request({
    url: mac.substring(0,3) == '555' ? baseUrlPark+ '/mp/getPicByroleCode' : baseUrlPark+ '/mp/getPicByroleCode',
    method:"get",
    params:{
      mac:mac,
      roleCode:roleCode
    }
  })

}
  

  export function  lockStatusApi(mac,roleCode){
    return request({
      url: mac.substring(0,3) == '555' ? baseUrlPark+ '/mp/statusByroleCode' : baseUrlPark+ '/mp/statusByroleCode',
      method:"get",
      params:{
        mac:mac,
        roleCode:roleCode
      }
    })
  
  }

  export function  getLiveImageApi(mac,roleCode,onLight){
    return request({
      url: mac.substring(0,3) == '555' ? baseUrlPark+ '/mp/getLiveImageByroleCode' : baseUrlPark+ '/mp/getLiveImageByroleCode',
      method:"get",
      params:{
        mac:mac,
        roleCode:roleCode,
        onLight:onLight
      }
    })
  
  }
  export function  radarApi(mac,roleCode){
    return request({
      url: mac.substring(0,3) == '555' ? baseUrlPark+ '/mp/radarByroleCode' : baseUrlPark+ '/mp/radarByroleCode',
      method:"get",
      params:{
        mac:mac,
        roleCode:roleCode
      }
    })
  
  }

  export function  queryRadarDistApi(mac,roleCode){
    return request({
      url: mac.substring(0,3) == '555' ? baseUrlPark+ '/mp/queryRadarDistByroleCode' : baseUrlPark+ '/mp/queryRadarDistByroleCode',
      method:"get",
      params:{
        mac:mac,
        roleCode:roleCode
      }
    })
  
  }


  export function   getMyBookByphoneApi(params){
    return request({
      url:baseUrl+"/lcbook/getMyBookByphoneAndmac",
      method:"get",
      params:params
    })
  }

  export function  lcfaultprocApi(data){
    return request({
      url:baseUrl+"/lcfaultproc",
      method:"post",
      data:data
    })
  }

  export function  lcfaultprocPutApi(data){
    return request({
      url:baseUrl+"/lcfaultproc",
      method:"put",
      data:data
    })
  }

  export function  softResetApi(mac,roleCode){
    return request({
      url: mac.substring(0,3) == '555' ? baseUrlPark+ '/mp/softResetByroleCode' : baseUrlPark+ '/mp/softResetByroleCode',
      method:"get",
      params:{
        mac:mac,
        roleCode:roleCode
      }
    })
  
  }


  export function loadOpPersonListApi(params){
    return  request({
        url: baseUrl+ "/lcqa/getLcQaByroleCode",
        methods: "get",
        params:params
      });
}

 


  

  

  
 

  

 
  
  

  
  

  
  

 



  
  

  